define([
	'jquery',
	'underscore',
	'backbone',
	'text!tpl/ParksListItemView.html',
	'collections/ParksCollection',
	'views/ParksListItemView'
], function( $, _, Backbone, parksListItemViewTemplate, ParksCollection, ParksListItemView ) {

	var ParksListItemView = Backbone.View.extend({

		tagName: 'li',

		className: "list-item",

		template: _.template( parksListItemViewTemplate ),

		events: {
			"click": "onClick"
		},

		initialize: function() {
			this.model.categoryName = Globals.GetCategoryName(this.model.categoryId);
		},

		render: function() {
			this.$el.attr('id', this.model.id);
			this.$el.addClass('region-' + this.model.regionId);
			this.$el.addClass('category-' + this.model.categoryId);
			this.$el.addClass('province-' + this.model.provinceId);
			this.$el.html(this.template(this.model))
			this.options.$parent.append(this.$el);
		},

		onClick: function(e){
			e.preventDefault();
			App.navigate('nationalsParks/' + this.model.id);
		}
	});

	return ParksListItemView;
});
